﻿<UserControl x:Class="WpfTwitterClient.Modules.Timelines.Views.HomeTimeline.HomeTimelineView"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
    <UserControl.Resources>
        <ResourceDictionary>
            <ResourceDictionary.MergedDictionaries>
                <ResourceDictionary Source="../../Resources/Resources.xaml"></ResourceDictionary>
            </ResourceDictionary.MergedDictionaries>
        </ResourceDictionary>
    </UserControl.Resources>
    
    <ListView ItemsSource="{Binding Path=Tweets}" Name="listView1" 
              ScrollViewer.HorizontalScrollBarVisibility="Disabled"
              ScrollViewer.VerticalScrollBarVisibility="Visible" 
              BorderThickness="0"
              VirtualizingStackPanel.IsVirtualizing="False">
        <ListView.ItemTemplate>
            <DataTemplate>
                <StackPanel>
                    <Grid Width="Auto" ShowGridLines="False">
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition Width="52"/>
                            <ColumnDefinition Width="*"/>
                        </Grid.ColumnDefinitions>
                        <Grid.RowDefinitions>
                            <RowDefinition></RowDefinition>
                            <RowDefinition></RowDefinition>
                        </Grid.RowDefinitions>
                        <Image Grid.Column="0" Source="{Binding Path=User.ProfileImageUrl}" SnapsToDevicePixels="True" Width="48" Height="48" HorizontalAlignment="Left" VerticalAlignment="Top"></Image>
                        <Grid Grid.Row="0" Grid.Column="1">
                            <Grid.RowDefinitions>
                                <RowDefinition/>
                                <RowDefinition/>
                                <RowDefinition/>
                            </Grid.RowDefinitions>
                        <TextBlock TextWrapping="Wrap" FontWeight="Bold" Foreground="Blue" Grid.Row="0" Text="{Binding Path=User.ScreenName}" />
                        <TextBlock TextWrapping="Wrap" Grid.Row="1" Text="{Binding Path=Text}" />
                        <TextBlock TextWrapping="Wrap" FontStyle="Italic" Foreground="Silver" FontSize="10" Grid.Row="2" Text="{Binding Path=Date}" />
                        </Grid>
                        <!--<FlowDocumentScrollViewer BorderThickness="1" VerticalScrollBarVisibility="Disabled" Grid.Row="0" Grid.Column="1" Document="{Binding Path=Document, Mode=OneWay}" VerticalAlignment="Top"></FlowDocumentScrollViewer>-->
                        <Separator Grid.Row="2" Margin="0,10,0,10" Grid.ColumnSpan="2"></Separator>
                    </Grid>
                </StackPanel>
            </DataTemplate>
        </ListView.ItemTemplate>
    </ListView>
</UserControl>
